package arch.dao.impl.archive;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import arch.domain.archive.Field;
/**
 * 
 * @author zhangxue
 *
 */
public class FieldRowMapper implements RowMapper {

	public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
		Field field = new Field();
		
		field.setId(rs.getInt("id"));
		field.setKey(rs.getString("key"));
		field.setName(rs.getString("name"));
		field.setDataType(rs.getString("data_type"));
		field.setLength(rs.getInt("length"));
		field.setEditStyle(rs.getString("edit_style"));
		field.setEditArgument(rs.getString("edit_argument"));
		field.setDisplayArgument(rs.getString("display_argument"));
		field.setLoggableString(rs.getString("loggable"));
		field.setQuery(rs.getString("query"));
		field.setEnableString(rs.getString("enable"));
		field.setDescription(rs.getString("description"));
		field.setDefaultValue(rs.getString("field_value"));
		field.setRestriction(rs.getString("restriction"));
		
		return field;
	}

}
